﻿@{
    ViewBag.Title = "Proveedores";
    Layout = "~/Views/Shared/_Layout.cshtml";
 
}
@using Helena.Areas.Proveedores.Models
@model IEnumerable<ProveedorView>           
@using Telerik.Web.Mvc.UI

@Html.Telerik().ScriptRegistrar().Globalization(true)

<style type="text/css">
    .t-window
    {
        width: 500px;
        margin: 0px auto;
    }
</style>


<div class="block big" style="position: relative">
    <!-- Block Begin -->
    <div class="titlebar">
        <h3>
            Administración de Proveedores
        </h3>
    </div>
    <div class="block_cont">
        @(Html.Telerik().Grid(Model)
        .Name("ProveedoresGrid")
        .Localizable("es-ES")
        .Filterable()
        .ToolBar(commands => commands.Insert())
        .Editable(editing => editing
                            .Mode(GridEditMode.PopUp)
                            .TemplateName("ProveedorViewTemplate"))
                            .HtmlAttributes(new { style = "position: relative, top: 50%, left: 60%, width: 900px" })
        .DataKeys(key => key.Add(c => c.ID))
        .Columns(columns =>
        {
            columns.Bound(c => c.RazonSocial);
            columns.Bound(c => c.Direccion);
            columns.Bound(c => c.RUC);
            columns.Bound(c => c.Telefono);
            columns.Bound(c => c.Contacto);
            columns.Bound(c => c.Estado).ClientTemplate("<input type='checkbox' disabled='disabled' name='Estado' <#= Estado? checked='checked' : '' #> />");
            columns.Command(commands =>
            {
                commands.Edit().ButtonType(GridButtonType.Image);
            }).Width(50).Title("Editar"); ;
        })
        .Pageable()
        .Sortable()
        .Selectable()
        .Scrollable(scrolling => scrolling.Height(250))
        .DataBinding(dataBinding => dataBinding
            .Ajax()
            .Select("Select", "Proveedor"/*, new { mode = GridEditMode.PopUp, type = GridButtonType.Image }*/)
            .Insert("Insert", "Proveedor"/*, new { mode = GridEditMode.PopUp, type = GridButtonType.Image }*/)
            .Delete("Delete", "Proveedor"/*, new { mode = GridEditMode.PopUp, type = GridButtonType.Image }*/)
            .Update("Update", "Proveedor"/*, new { mode = GridEditMode.PopUp, type = GridButtonType.Image }*/)
        )
    )
    </div>
    <!-- Table Wrapper End -->
</div>